﻿using UnityEngine;
using System.Collections;

public class LevelManager : Photon.MonoBehaviour 
{
	public Transform[] turretPositions;
	public Transform[] PickUpsPositions;
	
	public bool TurretsGenerations = true;
	public bool PickUpsGenerations = true;
	
	
	public void InstantiateTurrets()
	{
		if(TurretsGenerations)
		{
			for(int i = 0; i < turretPositions.Length; i++)
			{
				PhotonNetwork.Instantiate("Turret", turretPositions[i].position, turretPositions[i].rotation, 0);
			}
		}
	}
	
	
	public void InstantiatePickUps()
	{
		if(PickUpsGenerations)
		{
			for(int i = 0; i < turretPositions.Length; i++)
			{
				PickUps currPickUp = PickUpsPositions[i].GetComponent<PickUps>();
				
				string weapon = currPickUp.WeaponToSpawn.ToString();
				
				PhotonNetwork.Instantiate(weapon, PickUpsPositions[i].position, PickUpsPositions[i].rotation, 0);
			}
		}
	}
}
